package com.huabo.contract.oracle.mapper;

import com.huabo.contract.oracle.entity.TblContractInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-17
 */
public interface TblContractInformationMapper extends BaseMapper<TblContractInformation> {

    @InsertProvider(type=TblContractInformationMapperSqlConifg.class,method="saveContractInfoMation")
    @Options(useGeneratedKeys=true, keyProperty="infoid", keyColumn="INFOID")
    void saveContractInfoMation(TblContractInformation information);

    @UpdateProvider(type=TblContractInformationMapperSqlConifg.class,method="updateContractInfoMation")
    void updateContractInfoMation(TblContractInformation information);

    @Delete("DELETE FROM TBL_CONTRACT_INFORMATION WHERE INFOID = #{infoId}")
    void removeContractInfoMation(Integer infoId);

    @Select("SELECT * FROM TBL_CONTRACT_INFORMATION WHERE PROJECTID = #{contractId}")
    List<TblContractInformation> getInfomationList(String contractId);

    @Select("SELECT * FROM TBL_CONTRACT_INFORMATION WHERE PROJECTID = #{contractid} ")
    List<TblContractInformation> findInformationListById(BigDecimal contractid);
}
